%% Author: jafu
%% Created: 2013-6-16
%% Description: TODO: Add description to clock_tests
-module(clock_tests).
-compile(export_all).

%%
%% Include files
%%
-include_lib("eunit/include/eunit.hrl").

%%
%% Exported Functions
%%
-export([]).

%%
%% API Functions
%%
sleep(Time) ->
	receive
		_Any -> ok
	after Time ->
			ok
	end.

clock_test() ->
	Result1 = clock:start(1000, fun() -> io:format("tick ~p~n",[erlang:now()]) end),
	?assert(Result1),
	Result2 = clock:start(1000, fun() -> io:format("tick ~p~n",[erlang:now()]) end),
	?assert(Result2 == started ),
	sleep(2000),
	clock:stop(),
	sleep(2000),
	not_start = clock:stop().

%%
%% Local Functions
%%

